package com.example.hackover_client;

import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;

import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.RadioGroup;
import android.widget.Button;
import android.widget.TextView;
import android.view.View.OnClickListener;
import android.location.*;

public class SwitchListener implements OnClickListener{

	private Main mainApp;
	
	public SwitchListener(Main mainapp)
	{
		mainApp=mainapp;
	}
		 
        public void onClick(View v) {
            
            // Switching to Register screen
            RadioGroup rGroup = (RadioGroup) mainApp.findViewById(R.id.Sex);
            
            	if(mainApp.IntroState == "login")
            	{
            	rGroup.setVisibility(View.VISIBLE);

            	Button originalGo = (Button) mainApp.findViewById(R.id.btn_GO);
            	originalGo.setText("Register");
            	Button originalSwitch = (Button) mainApp.findViewById(R.id.btn_Switch);
            	originalSwitch.setText("Login");
            	
            	
            	mainApp.IntroState = "register";            	
            	}
            	else if(mainApp.IntroState == "register")
            	{
            	rGroup.setVisibility(View.INVISIBLE);

            	Button originalGo = (Button) mainApp.findViewById(R.id.btn_GO);
            	originalGo.setText("Login");
            	Button originalSwitch = (Button) mainApp.findViewById(R.id.btn_Switch);
            	originalSwitch.setText("Register");

            	mainApp.IntroState = "login";            	
            	}            
        }
}
